package cn.gov.pbc.dream.common;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.Setter;

public class BankFinancingMessageConst {

    public static final String UPLOAD_FILES = "UPLOAD_FILES";

    public static final String RESOLVE_STATUS = "RESOLVE_STATUS";

    @Getter
    @AllArgsConstructor
    public enum Status {
        RUNNING(0, "正在解析"),
        EMPTY(1, "无任务"),
        FINISH(2, "解析完成"),
        QUIT(3, "异常退出")
        ;
        int code;
        String value;
        public static Status codeOf(int code) {
            for (Status status : values()) {
                if(status.getCode() == code){
                    return status;
                }
            }
            return null;
        }
    }

    @Getter
    @AllArgsConstructor
    public enum Sign {
        PPI("PPI", "资产池及产品信息"),
        PCD("PCD", "产品募集信息"),
        PVD("PVD", "资产负债信息"),
        AF1("AF1", "资产池及产品基本信息修改申请"),
        AF2("AF2", "产品起始募集信息修改申请"),
        AF3("AF3", "产品终止信息修改申请"),
        AF4("AF4", "产品募集信息修改申请"),
        AF5("AF5", "资产负债信息修改申请"),
        AFF("AFF", "申请单反馈信息"),
        PIF("PIF", "产品及资产池代码处理情况"),
        FVR("FVR", "报文处理结果");
        String code;
        String value;

        public static Sign codeOf(String code) {
            for (Sign sign : values()) {
                if(sign.getCode().equals(code)){
                    return sign;
                }
            }
            return null;
        }
    }
}
